<template>
  <div class="equipment" v-cloak>
    <list class="list">
      <cell class="listItem" v-for="(item, index) in companyData" :key="index" @click="addClassFun(index)" :class="[company === index ? 'active' : '']">
        <text class="text" :class="[company === index ? 'activeText' : '']">{{item}}</text>
      </cell>
    </list>
  </div>
</template>
<script>
const eventBus = weex.requireModule('bmEvents')
export default {
  name: 'factor',
  data () {
      return {
          companyData: ['需新增村庄绿化面积', '农村街坊路', '农村公厕', '农村户厕', '污水处理及供水工程', '生活垃圾治理', '太阳能浴室', '农村节能路灯', '整村农宅抗震节能改造'],
          company: 0
      }
  },
  methods: {
    addClassFun (index) {
      this.company = index
      this.$emit('closeList')
      eventBus.emit('bottomTab', index)
    }
  }
}
</script>
<style scoped>
.equipment{
  width: 750px;
  background-color: rgba(0, 0, 0, 0.4);
  flex: 1;
}
.list{
  width: 750px;
}
.listItem{
  width: 750px;
  height: 100px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding-left: 20px; 
  border-bottom-color: #f5f5f5;
  border-bottom-style: solid;
  border-bottom-width: 1px;
  background-color: white;
}
.text{
  font-size:28px;
  font-family:PingFangSC-Regular;
  color:rgba(102,102,102,1);
}
.active{
  color: #fff;
  background-color: rgba(35,196,160,1);
}
.activeText{
    color: #fff;
}
[v-cloak] {
  display: none;
}
</style>